import sympy as sp

x = sp.symbols('x')
y = x**sp.sin(x)

# 方法1：直接使用对数求导法
ln_y = sp.ln(y)
deriv_ln = sp.diff(ln_y, x)
result = y * deriv_ln

print("对数求导法结果:")
sp.pprint(result.simplify())